home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / std / c / 276 < prev    next >
Text File  |  1996-08-06  |  3KB  |  55 lines

  1. Newsgroups: comp.lang.c,comp.std.c
  2. Path: in1.uu.net!world!mv!usenet
  3. From: ENGR@GSSI.MV.COM (Michael Furman)
  4. Subject: Re: Integral conversion e.t.c. (was: Re: Hungarian notation)
  5. Message-ID: <DM3wEy.FHH@mv.mv.com>
  6. Mime-Version: 1.0
  7. Organization: GSSI
  8. Date: Thu, 1 Feb 1996 16:56:57 GMT
  9. References: <30C40F77.53B5@swsbbs.com> <SPENCER.96Jan22113215@zorgon.ERA.COM> <TANMOY.96Jan29090518@qcd.lanl.gov>
  10. X-Newsreader: WinVN 0.93.10
  11. X-Nntp-Posting-Host: gssi.mv.com
  12.  
  13. In article <TANMOY.96Jan29090518@qcd.lanl.gov>, tanmoy@qcd.lanl.gov says...
  14. >
  15. >In article <KANZE.96Jan29121956@slsvewt.lts.sel.alcatel.de>
  16. >kanze@lts.sel.alcatel.de (James Kanze US/ESC 60/3/141 #40763) writes: 
  17. ><snip>
  18. >   I think the crux of Michael Furman's question lies therein.  Does the
  19. >   standard require a diagnostic if the function main is not of one of
  20. >   the two types given?
  21. >
  22.  
  23.   Not exactly. My question was not about diagnostics, but about usage
  24. of constructions that are not defined in standard.
  25. There are two kinds of undefined behavior:
  26. 1. When operation does not have any meaning. Example: assigning a value
  27.   to dereferenced incorrect pointer. In such cases sometimes it is very 
  28.   hard or impossible (at least on some platforms) to check it even at
  29.   execution time and it is really possible that hard disk will be
  30.   reformatted as a result of such operations.
  31. 2. When operation has meaning but can not be portable defined for all
  32.   platforms. Example: all number conversions that depends on internal
  33.   representation or some CPU specific (like rounding). But I have more
  34.   clear example: "asm" keyword. I found it is defined in C++ draft and
  35.   I believe it is defined in C standard. 
  36.   Was it inserted just to give programmers some way to implement undefined
  37.   behavior (with some chance to have disk reformatted)? I do not think so.
  38.  
  39. In C++ draft standard there are two words used in such cases: 
  40. "undefined behavior" and "implementation defined behavior" - and I think
  41. they are used accordingly for 1. and 2. As I understand now in C standard
  42. there is no such clear division. But it does not mean that the problem
  43. does not exist and I believe it is very wrong to claim that in every
  44. case where behavier is not defined by C standard we may loose all
  45. data from our hard disk!
  46. -- 
  47. <<<<<<<< This is a copy of post to the newsgroup >>>>>>>>
  48. ---------------------------------------------------------------
  49. Michael Furman,                       (603)893-1109
  50. Geophysical Survey Systems, Inc.  fax:(603)889-3984
  51. 13 Klein Drive - P.O. Box 97          engr@gssi.mv.com 
  52. North Salem, NH 03073-0097            71543.1334@compuserve.com
  53. ---------------------------------------------------------------
  54.  
  55.